package com.scau.meetingbook.controller;

import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import com.scau.meetingbook.service.RoomEquipmentService;
import com.scau.meetingbook.pojo.RoomEquipment;
import com.scau.meetingbook.vo.ResultVO;

import java.util.List;

@RestController
@RequestMapping("/roomEquipment")
public class RoomEquipmentController {

    @Autowired
    private RoomEquipmentService roomEquipmentService;

    @PostMapping("/insertRoomEquipment")
    public ResultVO insertRoomEquipment(@RequestBody RoomEquipment roomEquipment) throws Exception {
        return roomEquipmentService.insertRoomEquipment(roomEquipment);
    }

    @GetMapping("/getRoomEquipmentById")
    public ResultVO<RoomEquipment> getRoomEquipmentById(Integer id) throws Exception {
        return roomEquipmentService.getRoomEquipmentById(id);
    }

    @PutMapping("/updateRoomEquipmentById")
    public ResultVO updateRoomEquipmentById(@RequestBody RoomEquipment roomEquipment) throws Exception {
        return roomEquipmentService.updateRoomEquipmentById(roomEquipment);
    }

    @DeleteMapping("/deleteRoomEquipmentById")
    public ResultVO deleteRoomEquipmentById(Integer id) throws Exception {
        return roomEquipmentService.deleteRoomEquipmentById(id);
    }
}